<template>
  <!--循环dataList-->
  <li class = "row-container al-center album-li" v-for = "item in 8" :key = "item">
    <!--图片和专辑名-->
    <div class = "row-container al-center" style = "flex: 0 0 60%">
      <el-image style = "width:80px" :src = "logo" />
      <span style = "padding:0 10px  ">132</span>
    </div>
    <!--作者和歌曲数目-->
    <div class = "row-container al-center" style = "flex: 0 0 40%">
      <span v-if = "isAlbum" style = "flex: 0 0 80%">纳兰慧心</span>
      <span v-else style = "flex: 0 0 80%">专辑：{{ 1 }}</span>
      <span v-if = "isAlbum" style = "flex: 0 0 20%">{{ 2 }}首</span>
      <span v-else style = "flex: 0 0 20%">MV :{{ 3 }}</span>
    </div>
  </li>
</template>

<script setup>
import {reactive} from "vue";

import logo from "@/assets/logo.png";

const props = defineProps({
  isAlbum: Boolean,
  dataList: Array
})
const dataList = reactive(props.dataList)
console.log(dataList)
</script>

<style lang = "less" scoped>
.album-li {
  padding: 10px 30px;

  &:nth-child(2n) {
    background-color: #efefef;
  }
}
</style>